package com.aviation.sell_ticket.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Web配置类
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

	@Bean
	public LoginBlocking loginBlocking(){
		return new LoginBlocking();
	}

	/**
	 * 添加Web项目的拦截器
	 */
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(loginBlocking()).addPathPatterns("/**")
		.excludePathPatterns("/userAction/login","/userAction/sendVerificationCode","/userAction/logon","/userAction/changePassword","/CityAction/**","/FlightAction/**"
		,"/OrderAction/paymentCallback","/ThemeAction/**");
	}
}
